﻿@namespace MudBlazor
@typeparam T
@inherits MudBaseInput<Range<T>>
@using MudBlazor.Internal

<div class="@Classname" style="@Style">
    @if (Adornment == Adornment.Start)
    {
        <MudInputAdornment Class="@AdornmentClassname" Icon="@AdornmentIcon" Color="@AdornmentColor" Size="@IconSize" Text="@AdornmentText" Edge="@Edge.Start" AdornmentClick="@OnAdornmentClick" />
    }

    @if (InputType == InputType.Hidden && ChildContent != null)
    {
        <div class="@InputClassname">
            @ChildContent
        </div>
    }

    <input @ref="_elementReferenceStart" @attributes="UserAttributes" type="@InputTypeString" class="@InputClassname" @bind-value="@TextStart" @bind-value:event="@((Immediate ? "oninput" : "onchange"))"
           placeholder="@PlaceholderStart" disabled=@Disabled readonly="@ReadOnly" @onblur="@OnBlurred" @onkeydown="@InvokeKeyDown" @onkeypress="@InvokeKeyPress" @onkeyup="@InvokeKeyUp" inputmode="@InputMode.ToString()" pattern="@Pattern" />
    <MudIcon Class="mud-range-input-separator mud-flip-x-rtl" Icon="@Icons.Material.Filled.ArrowRightAlt" Color="@Color.Default" />
    <input @ref="_elementReferenceEnd" @attributes="UserAttributes" type="@InputTypeString" class="@InputClassname" @bind-value="@TextEnd" @bind-value:event="@((Immediate ? "oninput" : "onchange"))" inputmode="@InputMode.ToString()" pattern="@Pattern"
           placeholder="@PlaceholderEnd" disabled=@Disabled readonly="@ReadOnly" @onblur="@OnBlurred" @onkeydown="@InvokeKeyDown" @onkeypress="@InvokeKeyPress" @onkeyup="@InvokeKeyUp" />

    @if (Adornment == Adornment.End)
    {
        <MudInputAdornment Class="@AdornmentClassname" Icon="@AdornmentIcon" Color="@AdornmentColor" Size="@IconSize" Text="@AdornmentText" Edge="@Edge.End" AdornmentClick="@OnAdornmentClick" />
    }

    @if (Variant == Variant.Outlined)
    {
        <div class="mud-input-outlined-border"></div>
    }
</div>